/**
 * Created by 严俊东 on 2017/6/20.
 */
import special from './special'
import mobileRoute from './mobileRoute'
import sell from './sell'
import coinDetail from './coinDetail'

//手游页面 头部页面
const Header = r => require.ensure([], () => r(require('components/Header.vue')), '/mobile-game/index')
//手游账号详情页面 父组件 无实际显示路由页面
const Index = r => require.ensure([], () => r(require('components/mobileGame/index.vue')), '/mobile-game/index')
//手游账号详情页面
const AccountDetail = r => require.ensure([], () => r(require('components/mobileGame/accountDetail/AccountDetail.vue')), '/mobile-game/detail')
const AccountDetailNew = r => require.ensure([], () => r(require('components/mobileGame/accountDetail/AccountDetailNew.vue')), '/mobile-game/detailnew')
//我要卖页面 父组件 无实际显示路由页面
const SellIndex = r => require.ensure([], () => r(require('components/mobileGame/sell/index.vue')), '/mobile-game/sell/index')
//我要卖页面
const SellHome = r => require.ensure([], () => r(require('components/mobileGame/sell/home.vue')), '/mobile-game/sell/home');
//手游金币详情页面
const CoinDetailIndex = r => require.ensure([], () => r(require('components/mobileGame/coin_detail/index.vue')), '/mobile-game/coin-detail/index')
//手游列表页
const mobileGameList2 = resolve => {
  require.ensure([], () => {
      resolve(require('components/mobileGame/goodsList2/goods_list.vue'));
  }, '/mobile-game2');
}
export const mobileGame = {
  path: '/vue/mobile-game',
  name: 'MobileGame',
  component: Index,
  children: [
    {
      path: 'account-detail/:goodsId/:goods_source_type',
      name: 'MGAccountDetail',
      component: AccountDetail,
      meta: {isPublish: true, requireAuth: false}
    },
    {
      path: 'account-detail-new/:goodsId/:goods_source_type',
      name: 'MGAccountDetailNew',
      component: AccountDetailNew,
      meta: {isPublish: true, requireAuth: false}
    },
    {
      path: 'goods-list2/:gameId/:gameName/:goodsType',
      name: "MobileGameList2",
      components: {
          default: mobileGameList2,
      },
      meta: {isPublish: true, requireAuth: false}
    },
    special,
    mobileRoute
  ]
}

// 手游金币发布&购买 （1. 金币发布信息填写页 2. 金币发布成功页 3. 金币详情页 4. 金币下单页）
// 私有样式文件：css/mobile/(mg-)mobile-public.css （存放在根路由）
// 样式域：mg002
export const mobileCoin = {
  path: '/vue/coin',
  component: CoinDetailIndex,
  children: [
    ...coinDetail
  ]
}

export const mobileGameSell = {
  path: '/vue/sell',
  component: SellIndex,
  children: [
	  ...sell
  ],
  meta: {isPublish: true, requireAuth: false}
}
